using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Business;
public partial class CustomerPage_Product : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DataList1.DataSource = bProduct.getAllProduct();
        DataList1.DataBind();
    }

    protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        DataRowView dv = (DataRowView)e.Item.DataItem;
        int ProductID =(int) dv["productID"];
        GridView dlEQ = (GridView)e.Item.FindControl("gvEquipment");
        dlEQ.DataSource = bProduct_Equipment.getProduct_EquipmentByProductID(ProductID);
        dlEQ.DataBind();
    }

    protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName == "Redirect")
        {
            Response.Redirect("PlanView.aspx?ProductID="+e.CommandArgument.ToString());
        }
    }
}
